<template lang="html">
    <div>
        <common-table :columns="columns" :data="data"/>
    </div>
</template>

<script>
import CommonTable from '_c/CommonTable.vue'
import {
	getStaticError
} from "@/apis/static";
import moment from "moment";
export default {
	name: 'exceptionStatic',
	components: {
		CommonTable
	},
	data() {
		return {
			columns: [{
					title: '元素',
					key: 'el',
                    width: '80'
				},
				{
					title: '错误描述',
					key: 'msg',
					width: '180'
				},
				{
					title: 'src',
					key: 'src',
					width: ''
				},
				{
					title: 'href',
					key: 'href',
					width: ''
				},
				{
					title: '元素节点',
					key: 'html',
				},
                {
                    title: '发生时间',
                    key: 'createTime',
                    width: '170'
                }
			],
			data: []
		}
	},
	mounted() {
		getStaticError()
			.then(res => {
                res.data.forEach(item => {
                    item.createTime = moment(parseInt(item.createTime)).format("YYYY-MM-DD hh:mm:ss");
                })
                this.data = res.data;
			})
	}
}
</script>

<style lang="less" scoped>
</style>
